-
Notifications
You must be signed in to change notification settings - Fork 844
Remove considerations for Windows 2000 and Windows Vista #2667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Remove considerations for Windows 2000 and Windows Vista #2667
Conversation
2850ae8 to
b64507f
Compare
b64507f to
e1d0f07
Compare
e1d0f07 to
3c3a6e9
Compare
| #define CHECK_PFN(fname) \ | ||
| if (pfn##fname == NULL) \ | ||
| return PyErr_Format(PyExc_NotImplementedError, "%s is not available on this platform", #fname); | ||
| // Not available on Vista or earlier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't hate these comments because they help explain why there is a function pointer used. Removing the comment removes all context. I'm fine with updating the comment to be current and supply the context, or to remove the function pointer entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add back or modify the comment.
Edit: this file only contained a single CHECK_PFN usage, removed along with comment.
Anyway I realized it later, but I think all these CHECK_PFN macros can be removed (looks like they're all for functions that should now always exist at build and runtime).
But I'd do that in its own PR. The main concern there will be to not accidentally remove cygwin workaround/support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway I realized it later, but I think all these
CHECK_PFNmacros can be removed (looks like they're all for functions that should now always exist at build and runtime).
Right - I was trying to suggest that this means we can remove the function pointers entirely rather than just the null checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right - I was trying to suggest that this means we can remove the function pointers entirely rather than just the null checks.
that's what I ended up doing. Which rendered the line CHECK_PFN(SHGetPropertyStoreForWindow) dead code, so I removed it. Making the macro CHECK_PFN (in this file) unused, so I removed it.
| // interface. | ||
| static PyObject *PyAssocCreateForClasses(PyObject *self, PyObject *args) | ||
| { | ||
| // @comm This function is only available on Vista and later; a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda like the above, I think I'd rather just avoid using the function pointer entirely (and ditto below)
| Microsoft released a patch for handling time zones in 2007 (see | ||
| https://learn.microsoft.com/en-us/troubleshoot/windows-client/system-management-components/daylight-saving-time-help-support) | ||
| As a result, patched systems will give an incorrect result for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"will" seems more correct than "would" here. I get that maybe you are trying to refer to the past, but if any of those systems are still running and are patched, they will do what's described, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but if any of those systems are still running and are patched, they will do what's described, right?
Correct, although any of those systems can't run pywin32 anymore (all systems that can run pywin32 are vista-or-later). I kept the tests for coverage sake.
In french we have a verb tense specifically for this scenario ^^" (conditional past).
Anyway I don't mind changing back to will rather than would/would have.
Mostly updating obsolete documentation and simplifying some tests. I searched for the terms "Windows 2000" and "Vista".
Along with #2668, this removes all usages of
sys.getwindowsversion(), pushing the Python code to be more Windows-version agnostic.Most of the actual code changes had already been done in:
win32com.shell.shell: Drop support for Vista, set Windows 7 as the minimal Windows version. #2487